package com.slkj.shilixiaoyuanapp.ui.teacher.tool.homework;

import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.slkj.shilixiaoyuanapp.R;
import com.slkj.shilixiaoyuanapp.base.BaseLazyFragment;
import com.slkj.shilixiaoyuanapp.entity.HomeWorkDetailEntity;
import com.slkj.shilixiaoyuanapp.entity.ToolWorkListEntity;
import com.slkj.shilixiaoyuanapp.view.DividerItemDecoration;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;

/**
 * Created  on 2018-07-20
 *
 * @author 唐开阔
 * @describe 未交
 */
public class WorkDetailUnUpLoadFragment extends BaseLazyFragment{
    @BindView(R.id.recycer)
    RecyclerView recycerType;
    BaseQuickAdapter adapter;
    List<String> toolWorkListEntityList =new ArrayList<>();
    @Override
    protected int getResId() {
        return R.layout.fragment_tool_work_detail_upload;
    }

    @Override
    protected void onRealLoaded() {
        recycerType.addItemDecoration(new DividerItemDecoration(getContext(), LinearLayoutManager.VERTICAL));
        recycerType.setLayoutManager(new LinearLayoutManager(getContext()));
        adapter = new BaseQuickAdapter<String, BaseViewHolder>(R.layout.item_tool_work_un_upload, toolWorkListEntityList) {
            @Override
            protected void convert(BaseViewHolder helper, final String item) {
                helper.setText(R.id.tv_name,item);

            }
        };
        recycerType.setAdapter(adapter);
//        if (toolWorkListEntityList.size() == 0) {
//            adapter.setEmptyView(R.layout.statelayout_empty);
//        }
    }
    public void onDataBack(List<String> data){
        toolWorkListEntityList = data;
//        if (data.size() == 0){
//            adapter.setEmptyView(R.layout.statelayout_empty);
//        }else {
//            toolWorkListEntityList.addAll(data);
//            adapter.notifyDataSetChanged();
//        }
    }
}
